# isAdmin.coffee
#
# @description :: TODO: You might write a short summary of how this model works and what it represents here.
# @docs        ::

module.exports = (req, res, next) ->

  if req.session.wx
    return next()

  return res.json({
    code: 234,
    directUrl: 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxb37f6b74568f3aad&redirect_uri=http%3A%2F%2Fwww.kissbaby-toys.cn%2FweChat%2Fauth&response_type=code&scope=snsapi_userinfo&state=0#wechat_redirect'
#    directUrl: '/weChat/authTest'
  });
#  return res.redirect('https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxb37f6b74568f3aad&redirect_uri=http%3A%2F%2Fwww.kissbaby-toys.cn%2FweChat%2Fauth&response_type=code&scope=snsapi_userinfo&state=0#wechat_redirect');
